using System;
using System.Collections.Generic;
using System.Text;

namespace Calc.Operations
{
	public enum CalcResultType
	{
		Boolean,
		Decimal,
		Error
	}
	/// <summary>
	/// Represents the result of any calculation
	/// </summary>
	public class CalcResult
	{
		private CalcResultType _resultType;
		private bool _booleanResult = false;
		private double _decimalResult = double.MinValue;
		private string _errorMessage = null;

		public CalcResult(bool result)
		{
			_resultType = CalcResultType.Boolean;
			_booleanResult = result;
		}

		public CalcResult(double result)
		{
			_resultType = CalcResultType.Decimal;
			_decimalResult = result;
		}

		public CalcResult(string error)
		{
			_resultType = CalcResultType.Error;
			_errorMessage = error;
		}

		public CalcResultType ResultType
		{
			get { return _resultType; }
		}

		public bool BooleanResult
		{
			get { return _booleanResult; }
		}

		public double DecimalResult
		{
			get { return _decimalResult; }
		}

		public string ErrorMessage
		{
			get { return _errorMessage; }
		}

	}
}
